package SEApp.components.propertyCtrls {
	
	import UIFree.controls.uif_label;
	import UIFree.controls.uif_scrollbar;
	import UIFree.uif_component;
	import UIFree.uif_ecomponent;
	
	import flash.events.Event;
	import flash.geom.Rectangle;
	
	public class c_propertyBase extends uif_ecomponent {
		private var _title: uif_label;
		public static const WEIGHT: Number = 50;
		
		public function c_propertyBase(parent:uif_component, aData: Object, y: Number, a_height: Number) {
			var inner: Rectangle = parent.getInner();
			super(parent, inner.x, y, inner.width, a_height, 'property');
			createComponents();
			_data 		= aData;
			_title.text = _data.title;
		}
		
		protected function get title(): uif_label {
			return _title;
		}
		
		protected function get componentRect(): Rectangle {
			var rect: Rectangle = getInner();
			rect.top += title.height;
			return rect;
		}
		
		protected function get titleHeight(): Number {
			return style.titleHeight?style.titleHeight:height;
		}
		
		protected function createComponents(): void {
			var rect: Rectangle = getInner();
			_title = new uif_label(this, rect.x, rect.y, rect.width, titleHeight, style.title);
		}
		
		protected function doChange(e: Event): void {
			_data.value = getValue();
			dispatchEvent(new Event(Event.CHANGE, true));
		}
		
		protected function getValue(): Object {
			return 0;
		}
	}
}